#ifndef TCPCLIENT_H
#define TCPCLIENT_H

#include <QObject>
#include <QThread>
#include <QTcpSocket>
#include <QDebug>
#include <QJsonDocument>
#include <QJsonObject>
#include <QtEndian>

class TcpClient : public QThread
{
    Q_OBJECT
public:
    void sendMessages(QJsonObject obj);
    quint32 set_analysis1(QByteArray data);//十六进制转换十进制
    void analysis(QByteArray data);//解析
protected:
    void run()override;
    QByteArray getSendJsondata(QJsonObject obj);


signals:
    void sendMessage(QJsonObject obj);
    void receiveMessage(QJsonObject obj);

private:
    QTcpSocket *socket;
    QByteArray data;
};

#endif // TCPCLIENT_H

